package com.wwwarehouse.common.bean.filter;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by ShineF on 2017/7/11 0011.
 */


public class SeriesBean implements Parcelable {
    private String title;                 //标题
    private List<FilterBean> list;        //集合
    private int count;                    //一行显示多少个
    private boolean isSingle;             //单选还是多选

    public SeriesBean() {
    }

    public SeriesBean(String title, List<FilterBean> list, int count, boolean isSingle) {
        this.title = title;
        this.list = list;
        this.count = count;
        this.isSingle = isSingle;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<FilterBean> getList() {
        return list;
    }

    public void setList(List<FilterBean> list) {
        this.list = list;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isSingle() {
        return isSingle;
    }

    public void setSingle(boolean single) {
        isSingle = single;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeList(this.list);
        dest.writeInt(this.count);
        dest.writeByte(this.isSingle ? (byte) 1 : (byte) 0);
    }

    protected SeriesBean(Parcel in) {
        this.title = in.readString();
        this.list = new ArrayList<FilterBean>();
        in.readList(this.list, FilterBean.class.getClassLoader());
        this.count = in.readInt();
        this.isSingle = in.readByte() != 0;
    }

    public static final Parcelable.Creator<SeriesBean> CREATOR = new Parcelable.Creator<SeriesBean>() {
        @Override
        public SeriesBean createFromParcel(Parcel source) {
            return new SeriesBean(source);
        }

        @Override
        public SeriesBean[] newArray(int size) {
            return new SeriesBean[size];
        }
    };
}
